#import os
#import re
#import sys
#import time
#import urllib
import urllib2
#import cookielib
#import subprocess
#from crunchyDec import crunchyDec
#from BeautifulSoup import BeautifulSoup

class CrunchyPlayback:
	def __init__(self):
		self.subFormat = '.ass'
	
	def downloadHTML(self, url):
		self.currenturl = url
		opener = urllib2.build_opener()
		opener.addheaders =[('Referer', 'https://www.crunchyroll.com'),('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14')]
		self.opener = opener
		response = self.opener.open(self.currenturl)
		html = response.read()
		print "CRUNCHYROLL: --> Grabbing URL: "+self.currenturl
		self.referer = self.currenturl
		return html
